module TagsHelper  
  
   # Gets Tag Weight in relation to the tag with the maximum photos
   # Uses logarithmic weights
  def tagWeight(max,tag)
    return Math.log10(tag[1]) / Math.log10(max.to_f)
  end
  
  # Generate a CSS style string for a tag depending on it's weight
  def style_for_weight(weight)
    n = 0xff/3 + (0xff/2*weight).to_i
    return "font-size:#{1.0 + weight}em;color:rgb(#{n},#{n},#{n})"
  end
  
end
